<template>
  <div class="container">
    <!-- 导航栏 -->
    <div class="navbar">
      <div class="nav-items">
        <div class="nav-item" v-for="(item, index) in navItems" :key="index">
          <router-link :to="navLinks[index]" class="nav-link">
            <i :class="navIcons[index]"></i> {{ $t(item) }}
          </router-link>
        </div>
      </div>
    </div>
    <!-- 主内容区域 -->
    <div class="main-content">
      <!-- 子路由视图 -->
      <div class="content-container">
        <router-view></router-view>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      navItems: ['nav.record', 'nav.paybaoxiao', 'nav.illnesshistory', 'nav.examination'],
      navLinks: [
        '/Record',
        '/paybaoxiao',
        '/illnesshistory',
        '/examination'
      ],
      navIcons: [
        'el-icon-document',        // 健康档案
        'el-icon-money',           // 医疗报销
        'el-icon-first-aid-kit',   // 既往病史
        'el-icon-notebook-2'       // 体检报告
      ]
    };
  },
  methods: {
    messageSettings() {
      alert('消息/设置');
    }
  }
};
</script>

<style scoped>
/* 基础样式 - 调整为医疗风格 */
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: #f5f9fc;
  color: #2d3748;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(74, 175, 254, 0.1);
  max-width: 1200px;
  margin: 2rem auto;
  border: 1px solid #e3f2fd;
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(to bottom, #4f8bf9, #2ac9e6);
}

.navbar {
  margin-top: 0;
  text-align: center;
  border-bottom: 1px solid #e3f2fd;
  width: 100%;
  background: linear-gradient(135deg, 
    white 0%, 
    white 30%,  
    #3e92cc 60%, 
    #3e92cc 100%
  );
  margin-bottom: 30px;
  padding: 40px;
  border-radius: 10px;
}


.nav-items {
  display: flex;
  justify-content: space-around;
  max-width: 1000px;
  margin: 0 auto;
}

.nav-item {
  flex: 1;
  margin: 0 10px;
}

.nav-link {
  width:100px;
  display: block;
  background-color: #2196F3; /* 调整为医疗蓝 */
  padding: 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: white;
  min-width: 140px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255,255,255,0.2); /* 新增半透明边框 */
}

.nav-link:hover {
  background-color: #1976D2;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: rgba(255,255,255,0.4); /* 悬停时边框变亮 */
}
.nav-link i {
  margin-right: 8px;
  font-size: 16px;
}
.main-content {
  flex: 1;
  background-color: #e6f0ff;
  padding: 20px;
  box-sizing: border-box;
  width: 100%;
  border-top: 1px solid #e3f2fd; /* 新增顶部边框 */
}
.content-container {
  background-color: white;
  padding: 30px;
  box-sizing: border-box;
  max-width: 1000px;
  margin: 20px auto;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.1);
  border: 1px solid #e3f2fd;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
    margin: 1rem;
    border-radius: 8px;
  }
  
  .navbar {
    padding: 15px;
    border-bottom: none;
  }
  
  .logo {
    left: 15px;
    top: 30px;
  }
  
  .logo-img {
    width: 60px;
    height: 40px;
  }
  
  .nav-items {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .nav-item {
    margin: 5px 0;
  }
  
  .nav-link {
    width: 100%;
  }
  
  .content-container {
    padding: 20px;
  }
}
</style>